From 8e913c1995ced3efb40a1b6f5a5c304cb36fac85 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 7 Jun 2005 15:36:42 +0000 Subject: [PATCH] Add 'magellanx' format for Explorist user waypoint (.upt) SD files. --- gpsbabel/README | 9 +++++++++ gpsbabel/magproto.c | 41 ++++++++++++++++++++++++++++++++++++++--- gpsbabel/vecs.c | 9 ++++++++- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/gpsbabel/README b/gpsbabel/README index 101fb43ef..ad7ed3c5f 100644 --- a/gpsbabel/README +++ b/gpsbabel/README @@ -134,6 +134,15 @@ THE FORMATS Additional sub options: baud: may be 1200, 2400, 4800, 9600, 19200, but must match receiver. + MAGELLANX + + The SD card format used by the Magellan Explorist 300, 400, and 500. + It's identical to the Magellan SD format used by Meridian, but allows + longer waypoint names. + + You should name any file created with this format with a ".upt" + extension so the firmware can read it. + GARMIN Waypoint serial upload and download works reliably under both diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index 753fcd624..48151b532 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -46,6 +46,7 @@ static char *noack = NULL; static char *nukewpt = NULL; static int route_out_count; static int waypoint_read_count; +static int wpt_len = 8; typedef enum { mrs_handoff = 0, @@ -365,7 +366,7 @@ mag_verparse(char *ibuf) case mm_meridian: case mm_sportrak: icon_mapping = map330_icon_table; - setshort_length(mkshort_handle, 8); + setshort_length(mkshort_handle, wpt_len); setshort_mustupper(mkshort_handle, 0); mag_cleanse = m330_cleanse; break; @@ -794,7 +795,7 @@ mag_rd_init(const char *portname) } static void -mag_wr_init(const char *portname) +mag_wr_init_common(const char *portname) { if (bs) { bitrate=atoi(bs); @@ -841,6 +842,24 @@ mag_wr_init(const char *portname) QUEUE_INIT(&rte_wpt_tmp); } +/* + * Entry point for extended (explorist) points. + */ +static void +magX_wr_init(const char *portname) +{ + wpt_len = 20; + mag_wr_init_common(portname); + setshort_length(mkshort_handle, wpt_len); +} + +static void +mag_wr_init(const char *portname) +{ + wpt_len = 8; + mag_wr_init_common(portname); +} + static void mag_deinit(void) { @@ -1218,11 +1237,12 @@ mag_waypt_pr(const waypoint *waypointp) if (odesc && /* !is_file && */ (wptcmtcnt++ >= wptcmtcnt_max)) odesc[0] = 0; - sprintf(obuf, "PMGNWPL,%4.3f,%c,%09.3f,%c,%07.lf,M,%-.8s,%-.46s,%s", + sprintf(obuf, "PMGNWPL,%4.3f,%c,%09.3f,%c,%07.lf,M,%-.*s,%-.46s,%s", lat, ilat < 0 ? 'S' : 'N', lon, ilon < 0 ? 'W' : 'E', waypointp->altitude == unknown_alt ? 0 : waypointp->altitude, + wpt_len, owpt, odesc, icon_token); @@ -1441,3 +1461,18 @@ ff_vecs_t mag_fvecs = { NULL, mag_fargs }; + +/* + * Extended (Explorist) entry tables. + */ +ff_vecs_t magX_fvecs = { + ff_type_file, + FF_CAP_RW_ALL, + mag_rd_init, + magX_wr_init, + mag_deinit, + mag_deinit, + mag_read, + mag_write, + NULL, +}; diff --git a/gpsbabel/vecs.c b/gpsbabel/vecs.c index fd963f377..f524990c9 100644 --- a/gpsbabel/vecs.c +++ b/gpsbabel/vecs.c @@ -34,6 +34,7 @@ extern ff_vecs_t geo_vecs; extern ff_vecs_t gpx_vecs; extern ff_vecs_t mag_svecs; extern ff_vecs_t mag_fvecs; +extern ff_vecs_t magX_fvecs; extern ff_vecs_t mapsend_vecs; extern ff_vecs_t mps_vecs; extern ff_vecs_t gpsutil_vecs; @@ -112,9 +113,15 @@ vecs_t vec_list[] = { { &mag_fvecs, "magellan", - "Magellan SD files (as for Meridians)", + "Magellan SD files (as for Meridian)", NULL }, + { + &magX_fvecs, + "magellanx", + "Magellan SD files (as for eXplorist)", + "upt" + }, { &mapsend_vecs, "mapsend", -- 2.30.2